<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="itany">
        <input name="userName" type="text" v-model="name">
        <ul>
            <li v-for="item in list">{{item}}</li>
        </ul>
        <button @click="addItem()">添加元素</button>
    </div>
</body>
<script>
    Vue.config.devtools = false;
    new Vue({
        el:'#itany',
        data:{
            name:'xiaoming',
            list:[1,2,3]
        },
        methods:{
            addItem:function(){
                this.list.push(123);
            }
        }
    })
</script>
</html>